#ifndef LOG_H_
#define LOG_H_

#ifdef __cplusplus
extern "C" {
#endif

#define VM_DEBUG_LEVEL		5
#define VM_INFO_LEVEL		4
#define VM_WARN_LEVEL		3
#define VM_ERROR_LEVEL		2
#define VM_FATAL_LEVEL		1

/**
 * initialize the log system
 * The log system must be initialized before other functions is called.
 *
 * @param filename		the log file name.
 *										If the paramter is NULL, the log file name is set to "c:\\vre.log" as default.
 * @param log_level		log level.
 */
void vm_log_init(char* filename, int log_level);

/**
 * write the log information in debug level.
 *
 * @param fmt		string as the format of "printf" in C language.
 * @param ...		paramters
 */
void vm_log_debug(char* fmt, ...);

/**
 * write the log information in info level.
 */
void vm_log_info(char* fmt, ...);

/**
 * write the log information in warn level.
 */
void vm_log_warn(char* fmt, ...);

/**
 * write the log information in error level.
 */
void vm_log_error(char* fmt, ...);

/**
 * write the log information in fatal level.
 */
void vm_log_fatal(char* fmt, ...);

/**
 * close the log file
 */
void vm_log_close(void);

/**
 * set the debug level
*/
void vm_set_log_level(int log_level);

#ifdef __cplusplus
}
#endif

#endif